package sd.czw.com.mybottomnavigationbar;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by czw
 * desc 描述：
 * on 2017/10/16.
 */
public class ChildFragment extends Fragment {
    private View rootview;
    private TextView textview;

    public static ChildFragment newInstance(String titles) {
        Bundle args = new Bundle();
        args.putString("title",titles);
        ChildFragment fragment = new ChildFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootview = inflater.inflate(R.layout.fragment_n,container,false);

        String title = getArguments().getString("title");
        textview = (TextView) rootview.findViewById(R.id.tv_child);
        textview.setText(title);


        return rootview;
    }
}
